package demo5;

public class StackMain2 {
    public static void main(String[] args){
        MinStack stack=new MinStack();
        stack.push(1);
        stack.push(-2);
        stack.push(-1);
        stack.push(9);
        stack.pop();//弹出一个元素
        int num=stack.getmin();
        System.out.println("栈中最小值为："+num);
        System.out.println();
       int num2= stack.top();
        System.out.println("栈顶元素为："+num2);
    }
}
